{!! Html::style(env("APP_URL").'/assets/backend/libs/datepicker/bootstrap-datetimepicker.min.css') !!}

<div class="tabs-container">
    <div class="tab-content">
        <div id="tab-1" class="tab-pane active">
            <div class="panel-body">
                {!! Form::open( [ 'route' => ['admin.svip.member.list'], 'method' => 'get', 'id' => 'commentsurch-form','class'=>'form-horizontal'] ) !!}
                <div class="row">
                    <div class="col-md-6">
                        <div class="col-sm-6" style="padding-left: 0">
                            <div class="input-group date form_datetime">
                                        <span class="input-group-addon">
                                            <i class="fa fa-calendar"></i>&nbsp;&nbsp;加入时间</span>
                                <input type="text" class="form-control inline" name="stime"
                                       value="{{request('stime')}}" placeholder="开始时间" readonly>
                                <span class="add-on"><i class="icon-th"></i></span>
                            </div>
                        </div>
                        <div class="col-sm-5" style="padding-left: 0">
                            <div class="input-group date form_datetime">
                                        <span class="input-group-addon" style="cursor: pointer">
                                            <i class="fa fa-calendar"></i></span>
                                <input type="text" class="form-control" name="etime" value="{{request('etime')}}"
                                       placeholder="截止时间" readonly>
                                <span class="add-on"><i class="icon-th"></i></span>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-2">
                        <select name="plan_id" class="form-control">
                            <option value="">选择VIP等级</option>
                            @foreach($plans as $plan)
                                <option value="{{$plan->id}}" {{request('plan_id')==$plan->id?'selected':''}}>{{$plan->title}}</option>
                            @endforeach
                        </select>
                    </div>

                    <div class="col-md-3">
                        <div class="input-group">
                            <input type="text" name="mobile" value="{{request('mobile')}}" placeholder="请输入用户手机搜索"
                                   class=" form-control"> <span
                                    class="input-group-btn">
                                        <button type="submit" class="btn btn-primary">查找</button></span></div>
                    </div>
                    {!! Form::close() !!}
                    <div class="col-md-1">
                        <a class="btn btn-primary export-search-vip-member" data-toggle="modal"
                           data-target="#download_modal" data-backdrop="static" data-keyboard="false"
                           data-link="{{route('admin.svip.member.getExportData')}}"
                           data-url="{{route('admin.export.index',['toggle'=>'vip-xls'])}}"
                           id="vip-xls"
                           data-type="xls"
                           href="javascript:;">导出Excel</a>
                    </div>
                </div>


                <div class="hr-line-dashed"></div>

                <div class="table-responsive">
                    @if(count($members)>0)
                        <table class="table table-hover table-striped">
                            <tbody>
                            <!--tr-th start-->
                            <tr>
                                <th>用户</th>
                                <th>所属VIP计划</th>
                                <th>加入时间</th>
                                <th>金额</th>
                            </tr>
                            <!--tr-th end-->
                            @foreach ($members as $member)
                                <tr>
                                    <td>{{$member->user->mobile}}</td>
                                    <td>{{$member->plan->title}}</td>
                                    <td>{{$member->joined_at}}</td>
                                    <td>{{$member->order->price/100}}元</td>
                                </tr>
                            @endforeach

                            </tbody>
                        </table>
                        <div class="pull-left">
                            &nbsp;&nbsp;共&nbsp;{!! $members->total() !!} 条记录
                        </div>

                        <div class="pull-right id='ajaxpag'">
                            {!! $members->appends(request()->except('page'))->render() !!}
                        </div>
                    @else
                        <div>
                            &nbsp;&nbsp;&nbsp;当前无数据
                        </div>
                    @endif
                </div><!-- /.box-body -->
            </div>
        </div>
    </div>
</div>

<div id="download_modal" class="modal inmodal fade"></div>

{!! Html::script(env("APP_URL").'/assets/backend/libs/datepicker/bootstrap-datetimepicker.js') !!}
{!! Html::script(env("APP_URL").'/assets/backend/libs/datepicker/bootstrap-datetimepicker.zh-CN.js') !!}
{!! Html::script(env("APP_URL").'/assets/backend/libs/jquery.el/el.common.js') !!}

@include('member-backend::vip_member.includes.scripts')